﻿using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Model.Report;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DzInfo.DynamicFormModelPlugIn.Test
{
     [Description("【账表表单插件】SQL账表插件"), HotUpdate]
    public class GetSQLData: AbstractSysReportPlugIn
    {
        public override void AfterBarItemClick(AfterBarItemClickEventArgs e)
        {
            base.AfterBarItemClick(e);
            if (e.BarItemKey.EqualsIgnoreCase("tbGetCurrData"))
            {
                GetCurrData();
            }
        }

        private void GetCurrData()
        {
            var model = this.Model as SQLReportModel;
            if (model == null)
                return;
            var datas = model.GetData(model.StartRow, model.Limit);
            this.View.ShowMessage(String.Format("当前页数据有{0}行", datas.Rows.Count));
        }
    }
}
